       <?php
                if (empty($fecha)) {
                    $fec_reserva= "";
                  
                } else {
                    $fec_reserva = $fecha;
                
                }
                                  
                ?>
                
  <?php
    if (isset($msjReserva)) {
        echo "<script> alert('".$msjReserva."'); </script>";
    }
    ?>


<div class="page-content" style="background-color: #F8F8F8;">
    
    <div class="page-header position-relative">
        <h1>Reserva<small><i class="icon-double-angle-right"></i> Registro</small></h1>
    </div>
    
    
    <div class="row-fluid">
        <div class="span12">
      <div class="widget-main">
<form class="form-horizontal" action="<?php echo base_url("intranet/reserva/buscarHabitacionFecha"); ?>" method='post'>
   <label class="control-label" for="fecHab">Ingrese Fecha</label> 
    &nbsp;&nbsp;<input class="input-medium search-query fecha" id='fecHab' name='fecHab' type="date"   required="true"/>
    &nbsp;&nbsp; &nbsp;&nbsp;<button type="submit" class="btn btn-danger btn-small" >
Buscar
<i class="icon-search icon-on-right bigger-110"></i>
</button>
</form>
</div> 
            
          
        
            
        <div id="habitaciones" title="Habitaciones">
             
    <?php if(isset($registros)){ ?>
            <div class="row-fluid"><div class="span12 label label-large label-info arrowed-in arrowed-right"><b>
                         <i class="icon-bookmark-empty"></i>  HABITACIONES DISPONIBLES
                        </b></div></div>
    <div class="widget-body">
        <div class="widget-body-inner">
            <div class="widget-main">

                <div class="widget-header header-color-blue2">
                    <h5 class="bigger lighter"> <i class="icon-bell-alt"></i> Segundo Piso</h5>
                </div>
                <table style="width: 100%;"  >
                    <div class="widget-box pricing-box">
                        <tr>
                            <?php 
                            for ($c = 0; $c < 11; $c++) {
                                ?>

                                <td  style="height: 110px; width: 9%;"> <button  onclick="cargardatosHabRes(<?php echo $registros[$c]->id_habi; ?>,<?php echo $registros[$c]->nro_habi; ?>)" <?php
                                   if (isset($registros3)) {
                                        if ($registros3 != NULL) {
                                            foreach ($registros3 as $fila1) {
                                                if ($c + 1 == $fila1->habitacion) {
                                                    if ($fila1->est_reg == 1) {
                                                        echo " disabled='true' class='btn btn-app btn-danger radius-4 '";
                                                    }
                                                }
                                            }
                                        }
                                    } 
                                if (isset($registros2)) {
                                        if ($registros2 != NULL) {
                                            foreach ($registros2 as $fila1) {
                                                if ($c + 1 == $fila1->habitacion) {
                                                    if ($fila1->est_res == 1) {
                                                        echo " disabled='true' class='btn btn-app btn-warning radius-4 '";
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    ?>  class="btn btn-app"  type="button" style="height:95%; width: 95%; text-align: center; "><span style="font-size: 32px;"><?php echo $registros[$c]->nro_habi; ?></span></button></td>
<?php } ?>
                        </tr>
                </table>
                <div class="widget-header header-color-blue2">
                    <h5 class="bigger lighter"><i class="icon-bell-alt"></i> Tercer Piso</h5>
                </div>
                <table style="width: 100%;"  >
                    <tr><?php
                        for ($j = 11; $j < 22; $j++) {
                            ?>

                            <td  style="height: 110px; width: 9%;"><button onclick="cargardatosHabRes(<?php echo $registros[$j]->id_habi; ?>,<?php echo $registros[$j]->nro_habi; ?>)"  <?php
                              if (isset($registros3)):
                                    if ($registros3 != NULL) {
                                        foreach ($registros3 as $fila1) {
                                            if ($j + 1 == $fila1->habitacion) {
                                                if ($fila1->est_reg == 1) {
                                                    echo " disabled='true' class='btn btn-app btn-danger radius-4 '";
                                                }
                                            }
                                        }
                                    }
                                endif; 
                            if (isset($registros2)):
                                    if ($registros2 != NULL) {
                                        foreach ($registros2 as $fila1) {
                                            if ($j + 1 == $fila1->habitacion) {
                                                if ($fila1->est_res == 1) {
                                                    echo " disabled='true' class='btn btn-app btn-warning radius-4 '";
                                                }
                                            }
                                        }
                                    }
                                endif;
                                ?>  class="btn btn-app" style="height:95%; width: 95%; text-align: center; "><span style="font-size: 32px;"><?php echo $registros[$j]->nro_habi; ?></span></button></td>
<?php } ?>                                 </tr>
                </table>
                <div class="widget-header header-color-blue2">
                    <h5 class="bigger lighter"><i class="icon-bell-alt"></i> Primer Piso</h5>
                </div>
                <table style="width: 100%;"  >
                    <tr><?php for ($l = 22; $l < 26; $l++) { ?>
                            <td  style="height: 110px; width: 9%;"><button onclick="cargardatosHabRes(<?php echo $registros[$l]->id_habi; ?>,<?php echo $registros[$l]->nro_habi; ?>)" <?php
                              if (isset($registros3)):
                                    if ($registros3 != NULL) {
                                        foreach ($registros3 as $fila1) {
                                            if ($l + 1 == $fila1->habitacion) {
                                               if ($fila1->est_reg == 1) {
                                                    echo " disabled='true' class='btn btn-app btn-danger radius-4 '";
                                                }
                                            }
                                        }
                                    }
                                endif;  
                            if (isset($registros2)):
                                    if ($registros2 != NULL) {
                                        foreach ($registros2 as $fila1) {
                                            if ($l + 1 == $fila1->habitacion) {
                                               if ($fila1->est_res == 1) {
                                                    echo " disabled='true' class='btn btn-app btn-warning radius-4 '";
                                                }
                                            }
                                        }
                                    }
                                endif;
                                ?> class="btn btn-app"  style="height:95%; width: 95%; text-align: center; "><span style="font-size: 32px;"><?php echo $registros[$l]->nro_habi; ?></span></button></td>
                            <?php }?>
                        <td colspan="5"></td>
                    </tr>
                </table>
                <div class="widget-box pricing-box">
                    <div class="widget-header header-color-blue2">
                        <h5 class="bigger lighter" style="text-align: right; padding: 5px;"><i class="icon-asterisk "></i> Leyenda</h5>
                    </div>
                    <div class="widget-body" style=" padding: 10px; text-align: right;">
                        <button class="btn btn-danger btn-small">
                            <i class="icon-group"></i>
                        </button> <span>OCUPADO</span>
                        <button class="btn btn-warning btn-small">
                            <i class="icon-group"></i>
                        </button> <span>RESERVADO</span>
                        <button class="btn  btn-small">
                            <i class="icon-group"></i>
                        </button> <span>DISPONIBLE</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php } ?>
</div>    
            
            <br><br>
            
            <form action="<?php echo base_url("intranet/reserva/RegistrarReserva"); ?>" class="form-horizontal" method='post'>
                <div class="row-fluid">
                    <div class="span5">
                        <div class="control-group">
                           <label class="control-label" for="fecRese">Fecha Reserva</label>
                            <div class="controls">
                                <div class="row-fluid input-append">
                                    <input  id='fecRese' name='fecRese' type="text" value="<?php echo $fec_reserva; ?>" readonly="true" required="true" />
                                    <span class="add-on">
                                        <i class="icon-calendar"></i>
                                    </span>  
                                   
                                </div> 
                                
                            </div>                                               
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="ciu">Hab. N°</label>
                            <div class="controls">
                                <input type='hidden' id='id_habi' name='id_habi' required="true">
                                <input type='text' id='habi' class="span10" name='habi' readonly="true" required="true">
                                
                            </div>                                            
                        </div>
                        <div class="control-group">
                            <label class="control-label" id="lblNombre" for="nom"><span>Nombre</span></label>
                            <div class="controls">
                                <input type='hidden' id='cod' name='cod' value="" >
                                <input type='text' id='nom' name='nom' value=""  class="span12" required="true">
                            </div>                                            
                        </div>
                     
                    </div>
                    <div class="span5">
                        <div class="control-group">
                         <label class="control-label" for="hora"><span>Hora</span></label>
                            <div class="controls">
                                <div class="input-append bootstrap-timepicker">
                                    <input type='hidden' id='cod_reg' name='cod_reg' >                                
                                    <input type='text' id='hora' name='hora' class="hora input-small" required="true">
                                    <span class="add-on">
                                        <i class="icon-time"></i>
                                    </span>
                                </div>
                            </div>                                           
                        </div>
                    
                        
                        <div class="control-group">
                           <label class="control-label" for="tel">Teléfono</label>
                            <div class="controls">
                                <div class="row-fluid input-append">
                                    <input type='text' id='tel' name='tel' class="span5" value="" required="true">
                                    <span class="add-on">
                                        <i class="icon-phone"></i>
                                    </span>
                                </div>
                            </div>                                             
                        </div>
                        <div class="control-group">
                            <label class="control-label" id="lblNombre" for="agenV"><span>Agencia de Viaje</span></label>
                            <div class="controls">
                                
                                <input type='text' id='agenV' name='agenV' value=""  class="span12" >
                            </div>                                            
                        </div>
                       
                    </div>
                </div>
                <div class="form-actions">
                    <button type='submit' class='btn btn-primary'><i class="icon-save"></i> Guardar</button>                    
                </div>
                <div class="control-group">
                    <div class="row-fluid input-append">

                    </div>
                </div>
            </form>
        </div>
   
        
    </div>
</div>



